﻿CREATE TABLE [dbo].[eDocumente] (
    [IDDocument]       BIGINT           IDENTITY (1, 1) NOT NULL,
    [Cod]              VARCHAR (20)     NOT NULL,
    [Denumire]         VARCHAR (100)    NOT NULL,
    [Descriere]        VARCHAR (250)    NULL,
    [IDCatalog]        BIGINT           NULL,
    [IDUserProprietar] UNIQUEIDENTIFIER NULL,
    [Public]           BIT              CONSTRAINT [DF_eDocumente_Public] DEFAULT ((0)) NOT NULL,
    [IDTipDocument]    INT              NULL,
    [Copie]            BIT              NULL,
    [NrDoc]            VARCHAR (50)     NULL,
    [DataDoc]          DATETIME         NULL,
    CONSTRAINT [PK_eDocumente] PRIMARY KEY CLUSTERED ([IDDocument] ASC),
    CONSTRAINT [FK_eDocumente_aspnet_Users] FOREIGN KEY ([IDUserProprietar]) REFERENCES [dbo].[aspnet_Users] ([UserId]),
    CONSTRAINT [FK_eDocumente_eCatalog] FOREIGN KEY ([IDCatalog]) REFERENCES [dbo].[eCatalog] ([IDCatalog]),
    CONSTRAINT [FK_eDocumente_eDocumentTip] FOREIGN KEY ([IDTipDocument]) REFERENCES [dbo].[eDocumentTip] ([IDTipDocument])
);

